package EjemploSwingComponentes;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class FrameDemo {

    public static void main(String s[]) {
        JFrame frame = new JFrame("A Basic Frame");

        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        });

        JLabel label = new JLabel("Something to look at",
                                   new ImageIcon("Java.jpg"),
                                   JLabel.CENTER);
        label.setVerticalTextPosition(JLabel.TOP);
        label.setHorizontalTextPosition(JLabel.CENTER);
        frame.getContentPane().add(label, BorderLayout.CENTER);

        frame.pack();
        frame.setVisible(true);
    }

}